package com.bw.kotlindemo.java.model.net;

import com.bw.kotlindemo.java.model.bean.CloseLiveBean;
import com.bw.kotlindemo.java.model.bean.LiveBean;
import com.bw.kotlindemo.java.model.bean.LiveListBean;
import com.bw.kotlindemo.java.model.bean.LoginBean;
import com.bw.kotlindemo.java.model.bean.LoginResult;
import com.bw.kotlindemo.java.model.bean.TypeBean;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * desc:
 * create by xushaodong on 2023/2/22
 */
public interface ApiService {


    @Headers("Content-type: application/json")
    @POST("/small/user/v1/login")
    Observable<LoginBean> doLogin(@Body Map map);

    @Headers("userId:78")
    @GET("live-platform/findLiveTypeList")
    Observable<TypeBean> getListType();

    @GET("live-platform/findLiveList")
    Observable<LiveListBean> getLiveByType(@Query("liveType") int liveType, @Query("page") int page, @Query("size") int size);


//    @Multipart
//    @POST("live-platform/verify/openLive")
//    Observable<OpenLiveBean> openLive(
//            @Query("liveType") int liveType,
//            @Query("liveTitle") String liveTitle,
//            @Query("longitude") String longitude,
//            @Query("latitude") String latitude,
//            @Part MultipartBody.Part body);

    @Multipart
    @POST("live-platform/verify/openLive")
    Observable<LiveBean> openLive(
            @Query("liveType") int liveType,
            @Query("liveTitle") String liveTitle,
            @Query("longitude") String longitude,
            @Query("latitude") String latitude,
            @Part MultipartBody.Part body);

//    @Headers({"userId:79", "sessionId:167886914554879"})    //赵恒威 测试机
    @DELETE("/live-platform/verify/closeLive")
    Observable<CloseLiveBean> closeLive();


    @Headers("Content-type: application/json")
    @POST("/live-user/v1/register")
    Observable<Object> regUser(@Body Map map);

    @Headers("Content-type: application/json")
    @POST("/live-user/v1/login")
    Observable<LoginResult> doLogin24(@Body Map map);

}
